package com.hl.mapper;

import com.hl.pojo.ConsultantLevel;
import org.apache.ibatis.annotations.*;
import java.util.List;

@Mapper
public interface ConsultantLevelMapper {

    // 添加顾问级别
    @Insert("insert into consultant_level (level_name) values (#{levelName})")
    public Integer add(ConsultantLevel consultantLevel);

    // 查询所有顾问级别
    @Select("select * from consultant_level where del = 0")
    public List<ConsultantLevel> findAll();

    // 根据id删除顾问级别
    @Update("update consultant_level set del = 1 where id = #{id}")
    public Integer del(Integer id);

    // 根据id查询顾问级别
    @Select("select * from consultant_level where id = #{id} and del = 0")
    public ConsultantLevel findById(Integer id);

    // 更新顾问级别信息
    @Update("update consultant_level set level_name=#{levelName}, del=0 where id=#{id}")
    public Integer update(ConsultantLevel consultantLevel);
}
